package com.sk.bilibili.handler.numHandler;

import com.sk.bilibili.bean.VideoSet;
import org.springframework.stereotype.Component;

/**
 * @author 邵康
 * @date 2021/12/19 13:04
 */
@Component
public class VideoSetNumHandler extends BaseNumHandler<VideoSet>{

    @Override
    public void postHandle(VideoSet data) {
        data.setCoinNum(data.getCoinNum()+redisUtils.getNum(data,"coinNum"));
        data.setDanmuNum(data.getDanmuNum()+redisUtils.getNum(data,"danmuNum"));
        data.setCollectNum(data.getCollectNum()+redisUtils.getNum(data,"collectNum"));
    }

    @Override
    public void beforeHandle(VideoSet data) {
        redisUtils.clearNum(data,"coinNum","danmuNum","collectNum");
    }

}
